package com.grw.testcase

import java.util.List;

import org.openqa.selenium.By;
import org.testng.annotations.Test;

import com.grw.base.BaseTest;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidElement;
import com.grw.pages.ContactsPage;;

public class TestCase extends BaseTest {

	// 登录
	@Test(priority = 0)
	public void sshLogin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.login();
	}

	// 打开联系人页面
	@Test(priority = 1)
	public void testPaste() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.enterConPage();
	}

	// 系统联系人admin名片信息显示
	@Test(priority = 2)
	public void showAdmin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.showUser_admin();
	}

	// 发送邮件测试-邮箱不存在
	@Test(priority = 3)
	public void sendEmailAdmin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.sendEmail();
	}

	// 返回通讯录联系人页面
	@Test(priority = 4)
	public void userReturn() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.usersReturn();
	}

	// 显示联系人名片信息并返回
	@Test(priority = 5)
	public void showSecond() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.showSecondUser();
		contactsPage.usersReturn();
	}

	// 显示最后一个联系人名片信息
	@Test(priority = 6)
	public void showLast() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.showLastUser();
	}

	// 收藏一个联系人
	@Test(priority = 7)
	public void collecOnetUser() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.collectUser();
	}

	// 取消收藏一个联系人
	@Test(priority = 8)
	public void cancelcollectOneUser() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.cancelcollectUser();
	}

	// 发送邮件测试-邮箱存在
	@Test(priority = 9)
	public void sendCorrectEmail() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.sendEmail();
	}

	// 电话信息弹窗测试
	@Test(priority = 10)
	public void callWin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.callWindow();
	}

	// 关闭电话信息弹窗测试
	@Test(priority = 11)
	public void closeCallWin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.closeWindow();
	}

	// 手机信息弹窗测试
	@Test(priority = 12)
	public void phoneWin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.phoneWindow();
	}

	// 关闭手机信息弹窗测试
	@Test(priority = 13)
	public void closePhoneWin() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.closeWindow();
	}

	// 手机联系人添加到通讯录
	@Test(priority = 14)
	public void addUserCon() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.phoneAddWindow();
	}

	// 从通讯录页面返回
	@Test(priority = 15)
	public void addUserConReturn() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.addReturn();
	}

	// 由联系人名片信息进入聊天页面
	@Test(priority = 16)
	public void enterChat() throws InterruptedException {
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.enterChatting();
	}

	// 通过键盘事件输入消息，鼠标点击发送聊天消息
	@Test(priority = 17)
	public void startChat1() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.chatting1();
	}

	// 通过键盘事件输入消息，键盘enter键发送聊天消息
	@Test(priority = 18)
	public void startChat2() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.chatting2();
	}

	// 通过选中消息框直接输入消息，键盘enter键发送聊天消息
	@Test(priority = 19)
	public void startChat3() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.chatting3();
	}

	// 由聊天页面返回信息页面
	@Test(priority = 20)
	public void quitChat() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.quitChatting();
	}

	// 进入联系人搜索页面
	@Test(priority = 21)
	public void enterSearchPage() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.searchPage();
	}

	// 输入内容再删除，搜索剩余内容
	@Test(priority = 22)
	public void delCont() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.delContent();
	}

	// 退出联系人搜索页面，返回联系人主页面
	@Test(priority = 23)
	public void quitSearchPage() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.quitSearchPage();
	}

	// 不输入内容直接搜索
	@Test(priority = 24)
	public void searchNone() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.searchNone();
	}

	// 输入空格直接搜索
	@Test(priority = 25)
	public void searchSpace() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.searchSpace();
	}

	// 搜索已存在的具体一个联系人， 查看是否搜索成功
	@Test(priority = 26)
	public void searchRight() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.searchCorrectUser();
	}

	// 搜索多个联系人共同包含的关键字， 查看是否搜索成功
	@Test(priority = 27)
	public void searchKeyword() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.searchKeyword();
	}

	// 搜索不已存在的联系人， 查看是否搜索成功
	@Test(priority = 28)
	public void searchFalse() throws InterruptedException { 
		ContactsPage contactsPage = new ContactsPage(driver);
		contactsPage.searchFalseUser();
	}
}